AddCSLuaFile("gadmenu.lua")
AddCSLuaFile("gadcfg.lua")

function findPlayer(str)
	for _,v in pairs(player.GetAll()) do
		if string.match(v:Name(),str) then return v end
	end
end

concommand.Add( "gad_rcon",function(ply,cmd,args)
	if ply:IsSuperAdmin() then
		local cmdstr = ""
		for _,v in pairs(args) do cmdstr = cmdstr .. tostring(v) end
		game.ConsoleCommand(args[1].. " "..args[2].. "\n")
		return true
	else
		ply:ChatPrint( "Must be a super admin!")
		return false
	end
end)

concommand.Add( "gad_setmdl",function(ply,cmd,args) if ply:IsAdmin() then findPlayer(args[1]):SetModel(GetConVarString( "gad_mdl")) end end)

concommand.Add( "gad_setcol",function(ply,cmd,args) if ply:IsAdmin() then 
	findPlayer(args[1]):SetColor(GetConVarNumber( "gad_Red"),GetConVarNumber( "gad_Green"),GetConVarNumber( "gad_Blue"),GetConVarNumber( "gad_Alpha"))
	//findPlayer(args[1]):SetColor(ply:GetNWInt("Red"),ply:GetNWInt("Green"),ply:GetNWInt("Blue"),ply:GetNWInt("Alpha"))
end end)

concommand.Add( "gad_givewep",function(ply,cmd,args) if ply:IsAdmin() then findPlayer(args[1]):Give(args[2]) end end)

for _,v in ipairs(file.Find("../materials/gad/icons")) do resource.AddFile(v) end
for _,v in ipairs(file.Find("../materials/gad/client")) do resource.AddFile(v) end
 